/**
 * \file  therapy.cpp
 * \brief implementation of Therapy Class.
 *
 * ASO: Antiviral Sequence Optimizer
 * <http://aso.googlecode.com/>
 * Copyright (C) 2010 Velez Ezequiel, Peralta Andres, FuDePAN
 *
 * This file is part of the ASO project.
 *
 * Contents:      CPP file for ASO providing implementation of Therapy Class.
 *
 * System:         ASO
 * Language:       C++
 *
 * Author:         Velez Ezequiel, Peralta Andres
 * E-Mail:
 *
 * ASO is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * ASO is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ASO.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "aso-core/therapy.h"

//! nos dice si el nodo es una hoja
/*bool TherapyNode::is_leaf() const
{
    return children.empty();
}*/

bool TherapyNode::is_root() const
{
    return (parent == NULL);
}


void Therapy::get_antivital_names(std::string& output) const
{
    size_t i = 0;

    mili::CAutonomousIterator<Therapy> it(*this);
    while (!it.end())
    {
        std::string names;
        std::string temp;

        (*it)->antivirals.get_info(names);
        if (!names.empty())
        {
            temp += "Step " + mili::to_string(i) + ": " + names + "|" + "\n";
        }
        output += temp;
        ++it;
        ++i;
    }
}

